package app.mvc
{
	
	import app.mvc.controller.app.RegisterCommand;
	import app.mvc.controller.app.ImportClassCommand;
	import app.mvc.controller.app.StartOverCommand;
	import app.mvc.controller.app.StartUpCommand;
	
	import org.puremvc.as3.interfaces.IFacade;
	import org.puremvc.as3.patterns.facade.Facade;

	public class AppFacade extends Facade
	{
		
		public static function getInstance():AppFacade
		{
			if(Facade.instance == null)
				instance = new AppFacade();
			return instance as AppFacade;
		}
		
		override protected function initializeController():void
		{
			super.initializeController();
			//register some commands
			registerCommand(Notifications.APP_STARTUP,StartUpCommand);
			registerCommand(Notifications.APP_STARTUP_OVER,StartOverCommand);
			registerCommand(Notifications.APP_IMPORT_CLASS,ImportClassCommand);
			registerCommand(Notifications.APP_REGISTER_CLASS,RegisterCommand);
		}		
		public function startup($obj:Object):void
		{
			sendNotification(Notifications.APP_IMPORT_CLASS);
			sendNotification(Notifications.APP_REGISTER_CLASS);
			sendNotification(Notifications.APP_STARTUP,$obj);
		}
		
		public function AppFacade()
		{
			super();
		}
		
	}
}